package main

import (
	"poetry/database"
	"poetry/model"
	"poetry/server"
	// "poetry/download"
)

func main() {

	// 1. create table by gorm auto migrate
	StartTable()
	defer database.DB.Close()
	// download.PushDataIntoDB()
	// download.GetWorks()

	// 2、start http server
	server.New().Start()
}

// StartTable 数据库迁移
func StartTable() {
	database.DB.AutoMigrate(
		&model.Author{},
		&model.User{},
		&model.Poetry{},
	)
}
